package com.example.quickstartconsumer;

import com.example.quickstartconsumer.config.DefaultFeignConfig;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;

@SpringBootApplication
@EnableFeignClients(defaultConfiguration = DefaultFeignConfig.class,basePackages = "com.example.quickstartconsumer.client")
public class QuickstartConsumerApplication {

    public static void main(String[] args) {
        SpringApplication.run(QuickstartConsumerApplication.class, args);
    }

    //创建RestTemplate对象交给Spring管理
    @Bean
    public RestTemplate getRestTemplate() {
        return new RestTemplate();
    }
}
